package com.iyoudoock.citymine.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;

import com.iyoudoock.citymine.widget.wheel.adapter.AbstractWheelAdapter;
import com.iyoudoock.citymine.widget.wheel.adapter.AbstractWheelTextAdapter;
import com.kvin.toolkit.utils.region.ProvinceBean;

import java.util.ArrayList;

/**
 * Created by Kvin on 2017/5/27.
 */
public class ProvinceAdapter extends AbstractWheelTextAdapter {
    private ArrayList<ProvinceBean> provinceList;

    public ProvinceAdapter(Context context, ArrayList<ProvinceBean> provinceList) {
        super(context);
        this.provinceList = provinceList;
    }

    @Override
    protected CharSequence getItemText(int index) {
        return provinceList == null ? null : provinceList.get(index).getName();
    }

    @Override
    public int getItemsCount() {
        return provinceList == null ? 0 : provinceList.size();
    }

}
